/* 
 * For each page announciating an upcoming redirection, this script dynamically
 * shows the number of seconds left before the page reloads (i.e. 5, 4, 3, ...0).
 * @author Christophe Sourisse
 */

// Initiate the decrease process
$(document).ready(function(){
   setTimeout("decreaseValue()", 1000);
});

function decreaseValue() {
   var valCourante = $("#time").text();
   
   // If the current value isn't yet equal to 0, decrease it and set the next timeout.
   if (valCourante > 0) {
      $("#time").text(valCourante-1);
      setTimeout("decreaseValue()", 1000);
   }
}